<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf" xmlns:c="http://java.sun.com/jstl/core"
		>

	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<f:loadBundle basename="bundle.department" var="departmentBundle"/>
		<ui:param name="title" value="Plans List"/>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<f:loadBundle basename="bundle.plan" var="plansBundle"/>

					<h:panelGrid styleClass="centerHeader">
						<h:outputText value="#{studentBundle.markSheet}"/>
					</h:panelGrid>

					<a4j:form>

						<h:panelGrid id="markSheetPanel" columns="2">
							<h:outputText value="#{departmentBundle.faculty}"/>
							<itdep:entitySelectMenu value="#{planBean.filter.faculty}"
													entityType="faculty" format="{i18n.fullName}" anyvalue="true"
													required="true" style="width:150px">
								<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
							</itdep:entitySelectMenu>
							<h:outputText value="#{planBundle.speciality}"/>
							<itdep:entitySelectMenu value="#{contentPlanBean.filter.plan}"
													entityType="plan" format="{speciality.i18n.fullName} {year}"
													anyvalue="true"
													filter="#{planBean.filter}"
													required="true" style="width:150px">
								<a4j:support event="onchange" action="#{markSheetBean.filterGroup}"
											 reRender="markSheetPanel" ajaxSingle="true"/>
							</itdep:entitySelectMenu>
							<h:outputText value="#{departmentBundle.studentGroup}"/>
							<itdep:entitySelectMenu value="#{markSheetBean.studFilter.studentGroup}"
													entityType="student-group" format="{i18n.description}"
													anyvalue="true"
													filter="#{studentGroupBean.filter}"
													required="true" style="width:150px">
								<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
							</itdep:entitySelectMenu>
							<h:outputText value="#{planBundle.semester}"/>
							<h:selectOneListbox value="#{formOfControlSemesterBean.filter.term}" id="term"
												style="width:50px"
												size="1">
								<f:selectItem itemValue="1"/>
								<f:selectItem itemValue="2"/>
								<f:selectItem itemValue="3"/>
								<f:selectItem itemValue="4"/>
								<f:selectItem itemValue="5"/>
								<f:selectItem itemValue="6"/>
								<f:selectItem itemValue="7"/>
								<f:selectItem itemValue="8"/>
								<f:selectItem itemValue="9"/>
								<f:selectItem itemValue="10"/>
								<f:selectItem itemValue="11"/>
								<f:selectItem itemValue="12"/>

								<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
							</h:selectOneListbox>
							<h:outputText value="#{studentBundle.finishDate}"/>

							<rich:calendar value="#{markSheetBean.dateFinish}" inputSize="14"/>


							<h:outputText value="#{plansBundle.subject}"/>


							<rich:dataTable id="semesterPlanFormsOfControl"
											value="#{formOfControlSemesterBean.dataModel}" var="record"
											binding="#{formOfControlSemesterBean.tableBinding}"
											width="120px">
								<rich:column width="70px">
									<itdep:entityOutput value="#{record}"
														format="{semesterPlan.contentPlan.subject.i18n.fullName} {formOfControl.i18n.fullName}"
														locale="#{formOfControlDicBean.translationBean.locale}"/>
								</rich:column>

								<rich:column width="20px">
									<h:selectBooleanCheckbox value="#{record.markSheetCreate}"
															 id="markSheetCreate"/>
								</rich:column>
								<rich:column width="20px">
									<itdep:entitySelectMenu value="#{record.markSheet.employee}"
															entityType="employee"
															filter="#{employeeBean.filter}"
															format="{firstName} {lastName}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel"
													 ajaxSingle="true"/>
									</itdep:entitySelectMenu>
								</rich:column>
							</rich:dataTable>


							<a4j:commandButton value="#{commonBundle.save}"
											   action="#{markSheetBean.saveMarkSheetList}"/>
							<a4j:commandButton value="#{commonBundle.cancel}" action="#{markSheetBean.cancel}"
											   immediate="true"/>
						</h:panelGrid>
					</a4j:form>

				</ui:define>


			</ui:decorate>
		</ui:define>
	</ui:decorate>
</f:view>